<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>" />
<title><?php echo $this->getTitle() ?></title>
<meta name="description" content="<?php echo htmlspecialchars($this->getDescription()) ?>" />
<meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" />
<meta name="robots" content="<?php echo htmlspecialchars($this->getRobots()) ?>" />
<link rel="icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
<script type="text/javascript">
//<![CDATA[
	var urlSkinsite='<?php echo $this->getSKinUrl(); ?>';
//]]>
</script>
<!--[if lt IE 7]>
<script type="text/javascript">
//<![CDATA[
    var BLANK_URL = '<?php echo $this->helper('core/js')->getJsUrl('blank.html') ?>';
    var BLANK_IMG = '<?php echo $this->helper('core/js')->getJsUrl('spacer.gif') ?>';
//]]>
</script>
<![endif]-->
<script type="text/javascript">
var ADAPT_CONFIG = {
  path: "<?php echo $this->getSkinUrl('css') ?>/",
  dynamic: true,
  range: [
    '0px    to 760px  = mobile.css',
    '760px  to 980px  = 720.css',
    '980px  to 1200px = 960.css',
    '1200px           = 1200.css'
  ]
};
</script>
<?php	$helper = Mage::helper('wishcartsettings');	?>
<script type="text/javascript">
//<![CDATA[
	var review = '<?php echo $this->__('Review');?>';
    var isMobile = /iPhone|iPod|iPad|Phone|Mobile|Android|hpwos/i.test(navigator.userAgent);
    var isPhone = /iPhone|iPod|Phone|Android/i.test(navigator.userAgent);
	var baseUrl = '<?php echo Mage::getBaseURL() ?>';
    var AJAXCART_AUTOCLOSE = '<?php echo $helper->getAjaxcart_AutoClose(0) ?>';
    var FREEZED_TOP_MENU = '<?php echo $helper->getGeneral_FreezedTopMenu(0) ?>';
    var Viewmode = '<?php echo $helper->getImageProduct_Viewmode() ?>';
//]]>
</script>
<?php echo $this->getCssJsHtml() ?>
<?php echo $this->getChildHtml() ?>
<?php echo $this->helper('core/js')->getTranslatorScript() ?>
<?php echo $this->getIncludes() ?>
<script type="text/javascript">
jQuery(function($) {
	if(isMobile == true){
		<?php if (Mage::getSingleton('customer/session')->isLoggedIn()==0): ?>
			$('#link-account').attr('href','javascript:void(0)');
			$("#link-account").click(
				function( event ){
					$('#top-links').slideToggle();
					$('#block-cart').slideUp();
				}
			);
		<?php endif ?>

		$('#top_cart').attr('href','javascript:void(0)');
		$("#top_cart").click(
			function( event ){
				$('#block-cart').slideToggle();
				$('#top-links').slideUp();
			}
		);
	}else{
		$('#top_cart')
		.bind('mouseover', showmenu)
		.bind('click', showmenu)
		.bind('mouseout', hidemenu);

		$('#block-cart')
		.bind('mouseover', showmenu)
		.bind('click', hidemenu)
		.bind('mouseout', hidemenu);

		$('#top-links')
		.bind('mouseover', showLinks)
		.bind('click', showLinks)
		.bind('mouseout', hideLinks);

		$('#link-account')
		.bind('mouseover', showLinks)
		.bind('click', showLinks)
		.bind('mouseout', hideLinks);
	}

	var timeout = null;
	function hidemenu() {
		if (timeout)
			clearTimeout(timeout);
		timeout = setTimeout(function() {
			timeout = null;
			$('#block-cart').slideUp();
			$('#top_cart').removeClass('over');
		}, 200);
	}

	function showmenu() {
		$('#top-links').css('display','none');
		if (timeout)
			clearTimeout(timeout);
		timeout = setTimeout(function() {
			timeout = null;
			$('#block-cart').slideDown();
			$('#top_cart').addClass('over');
		}, 200);
	}

	var timeout1 = null;
	function hideLinks() {
		if (timeout1)
			clearTimeout(timeout1);
		timeout1 = setTimeout(function() {
			timeout1 = null;
			$('#top-links').slideUp();
			$('#link-account').removeClass('over');
		}, 200);
	}

	function showLinks() {
		$('#block-cart').css('display','none');
		if (timeout1)
			clearTimeout(timeout1);
		timeout1 = setTimeout(function() {
			timeout1 = null;
			$('#top-links').slideDown();
			$('#link-account').addClass('over');
		}, 200);
	}

});
</script>